<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
    <div class="app">
<div class="welcome" :style="{opacity}">欢迎来到Vue</div>
    </div>
    <script>
        const vm = new  Vue({
            data:{
                opacity:1
            },
            // 在实例创建完成后，调用该方法
            mounted(){
                setInterval(() => {
                    if(this.opacity>0){
                        this.opacity-=0.1;
                        console.log(this.opacity);
                    }
                }, 100);
            }
        })
        vm.$mount('.app')
    </script>
</body>
</html>